import React, { Component } from 'react'
import "./Ref.css"

export default class Ref extends Component {
    fn = ()=>{
      
      let value = this.refs.input.value
      this.refs.boxs.innerHTML=value
      this.refs.input.value=""
    }
  render() {
    return (
      <div>
        <input ref="input" type="text" name="" id="" className='in' />
        <button className='button' onClick={this.fn}>点我提交吧</button>
        <div ref="boxs" className='box'></div>
      </div>
    )
  }
}
